#ifndef SKPREADER_HPP
#define SKPREADER_HPP

#include <string>

template <class T> 
class SkpBase {
  public:
    SkpBase(T* impl)
      : m_impl(impl)
    {}
    T* getImpl() const
    {
      return m_impl;
    }
    bool isNull() const{
      return m_impl == NULL;
    }
  private:
    T* m_impl;
};

struct ISkpEntityProviderStatistics;
class SkpEntityProviderStatistics : public SkpBase<ISkpEntityProviderStatistics>
{
public:
  enum StatisticsType{
    StatEdge	= 0,
	  StatFace	= 1,
	  StatComponentInstance	= 2,
	  StatConstructionLine	= 3,
	  StatConstructionPoint	= 4,
	  StatGroup	= 5,
	  StatImage	= 6,
	  StatCurve	= 7,
	  StatSection	= 8,
	  StatDimension	= 9,
	  StatText	= 10,
	  StatComponentDefinition	= 11
  };

  SkpEntityProviderStatistics(ISkpEntityProviderStatistics* impl);
  virtual long numTypes() const;
  virtual std::string getTypeName( StatisticsType typeIndex) const;
  virtual long getCount(StatisticsType typeIndex, bool includeInstances) const;
};

struct ISkpFace;
class SkpFace : public SkpBase<ISkpFace>
{
public:
	SkpFace(ISkpFace* impl);
};

struct ISkpFaces;
class SkpFaces : public SkpBase<ISkpFaces>
{
public:
	SkpFaces(ISkpFaces* impl);
	SkpFace item(long index);
};

struct ISkpEntityProvider;
class SkpEntityProvider : public SkpBase<ISkpEntityProvider>
{
public:
  SkpEntityProvider(ISkpEntityProvider* impl);
  SkpFaces faces() const;
  SkpEntityProviderStatistics statistics() const;
};

struct ISkpDocument;
class SkpDocument : public SkpBase<ISkpDocument>
{
public:
  SkpDocument(ISkpDocument* impl);
  SkpEntityProvider entityProvider() const;
  void print() const;
};

struct ISkpFileReader;
class SkpFileReader : public SkpBase<ISkpFileReader>
{
public:
  SkpFileReader(ISkpFileReader* impl);
  SkpDocument openFile(const std::string& filePath);
};

struct ISkpTextureWriter;
class SkpTextureWriter : public SkpBase<ISkpTextureWriter>
{
public:
	SkpTextureWriter(ISkpTextureWriter* impl);
	virtual long count() const;
	virtual long loadFace(SkpFace face, bool front) const;
	virtual std::string getTextureFile(long textureHandle) const;
	virtual int writeAllTextures(std::string directoryName, bool use83) const;
};

struct ISkpApplication;
class SkpApplication : public SkpBase<ISkpApplication>
{
public:
  SkpTextureWriter createTextureWriter();
  static SkpApplication getApplication();
  SkpApplication(ISkpApplication* impl);
  virtual std::string name() const;
  virtual SkpDocument activeDocument() const;
  virtual SkpFileReader fileReader() const;
};
#endif // SKPREADER_HPP